package com.github.kezhenxu94.acs;

import java.util.ArrayList;
import java.util.List;

import com.github.kezhenxu94.acs.common.Colony;
import com.github.kezhenxu94.acs.common.Environment;
import com.github.kezhenxu94.acs.common.Model;

/**
 * Created by kezhenxu on Dec 19, 2016
 *
 * @author kezhenxu (kezhenxu94@163.com)
 */
public class AntColony implements Colony {
	protected List<Ant>		ants;
	protected Environment	environment;

	public AntColony(Environment environment) {
		this.environment = environment;
		this.ants = new ArrayList<>(environment.getColonySize());
		for (int i = 0; i < environment.getColonySize(); i++) {
			Ant ant = new Ant();
			ant.setEnvironment(environment);
			ants.add(ant);
		}
	}

	@Override
	public int getColonySize() {
		return ants.size();
	}

	@Override
	public Model construct() {
		return null;
	}

	@Override
	public Ant getAgent(int index) {
		return ants.get(index);
	}

}
